<!doctype html>
<html>

<head>
	<meta charset="UTF-8">
	<title>预览简历</title>
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link rel="stylesheet" href="css/mui.min.css" />
	<!-- build:css css/app.css -->
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/common.css" />
	<!-- endbuild -->
	<style>
		.time-axis {
			margin-top: 5px;
			padding: 0 10px;
			padding-bottom: 10px;
			background: #ffffff;
		}

		.time-axis .desc {
			margin-right: 30px;
			font-size: 13px;
			line-height: 20px;
			color: #999999;
		}

		.time-axis .flex-row-center {
			margin-top: 15px;
		}

		.time-axis .title {
			padding: 10px 0;
			font-size: 15px;
			border-bottom: 1px solid #dddddd;
		}

		.time-axis .comp {
			color: #333333;
			font-size: 14px;
			font-weight: bold;
		}

		.time-axis .time {
			font-size: 12px;
			color: #999999;
		}

		.time-axis .position {
			font-size: 14px;
		}

		.time-axis .position,
		.time-axis .desc {
			margin-top: 14px;
		}

		.time-axis .flex-row-center,
		.time-axis .position,
		.time-axis .desc {
			margin-left: 10px;
		}

		.time-axis.no .comp {
			margin-top: 10px;
		}

		.time-axis.no .flex-row-center {
			margin: 0;
		}

		.time-axis.no .flex-row-center .desc {
			margin-left: 0;
			margin-top: 5px;
		}
	</style>
</head>

<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">预览简历</h1>
	</header>
	<div class="mui-content">
		<div class="resume">
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<span>照片</span>
					<div class="weui-uploader__input-box"></div>
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>
						<span class="red">*</span>姓名
					</label>
					<input type="text" id="name" disabled />
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>
						<span class="red">*</span>手机号
					</label>
					<input type="text" id="phone" disabled />
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>
						<span class="red">*</span>性别
					</label>
					<input type="text" id="sex" disabled />
					<i class="mui-icon mui-icon-arrowright"></i>
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>
						<span class="red">*</span>出生日期
					</label>
					<input id="date" type="text" data-toggle='date' disabled />
					<i class="mui-icon mui-icon-arrowright"></i>
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>工作经验</label>
					<input id="word" type="text" disabled />
					<i class="mui-icon mui-icon-arrowright"></i>
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>求职状态</label>
					<input id="status" type="text" disabled />
					<i class="mui-icon mui-icon-arrowright"></i>
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>最高学历</label>
					<input id="edu" type="text" disabled />
					<i class="mui-icon mui-icon-arrowright"></i>
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>专业</label>
					<input type="text" id="major" disabled />
				</div>
			</div>
			<div class="margin-top-default resume-list">
				<div class="wrapper flex-row-center">
					<label>籍贯</label>
					<input type="text" id="native-place" disabled />
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>现住地址</label>
					<input type="text" id="address" disabled />
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>政治面貌</label>
					<input id="outlook" type="text" disabled />
					<i class="mui-icon mui-icon-arrowright"></i>
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper flex-row-center">
					<label>个人邮箱</label>
					<input type="text" id="email" disabled />
				</div>
			</div>
			<div class="resume-list">
				<div class="wrapper">
					<label>自我评价</label>
				</div>
				<textarea id="self-evaluation" disabled></textarea>
			</div>
			<div id="history" class="time-axis">
				<div class="title">工作经历</div>
			</div>
			<div id="experiences" class="time-axis">
				<div class="title">项目经验</div>
			</div>
			<div id="educations" class="time-axis no">
				<div class="title">教育经验</div>
			</div>
		</div>
	</div>
	<script src="js/mui.min.js"></script>
	<script src="js/zepto.min.js"></script>
	<script src="js/template-web.js"></script>
	<!-- build:js js/app.js -->
	<script src="js/api.js"></script>
	<script src="js/tools.js"></script>
	<!-- endbuild -->
	<script src="js/utils.js"></script>
	<script>
		function init(res) {
			if (res['heardImage']) {
				var img = document.createElement('img');
				img.className = 'logo';
				img.src = res['heardImage'];
				$('.weui-uploader__input-box').hide().before(img);
			}
			if (res['name']) {
				$('#name').val(res['name'])
			}
			if (res['telphone']) {
				$('#phone').val(res['telphone'])
			}
			if (res['sex']) {
				$('#sex').val(config.sexArray[res['sex']])
			}
			if (res['birthday']) {
				$('#date').val(res['birthday'])
			}
			if (res['workAge']) {
				$('#word').val(config.resume_experience[res['workAge']])
			}
			if (res['jobStatus']) {
				$('#status').val(config.joinstauts[res['jobStatus']])
			}
			if (res['education']) {
				$('#edu').val(config.resume_edu[res['education']])
			}
			if (res['specialty']) {
				$('#major').val(res['specialty'])
			}
			if (res['nativePlace']) {
				$('#native-place').val(res['nativePlace'])
			}
			if (res['nativePlace']) {
				$('#address').val(res['nativePlace'])
			}
			if (res['politicsStatus']) {
				$('#outlook').val(config.politics[res['politicsStatus']])
			}
			if (res['email']) {
				$('#email').val(res['email'])
			}
			if (res['selfDesc']) {
				$('#self-evaluation').val(res['selfDesc'])
			}
			if (res['histories']) {
				var obj = {};
				obj.list = res['histories'];
				$('#history').append(template('history-modules', obj))
			}
			if (res['editHistory']) {
				var obj = {};
				obj.list = res['editHistory'];
				$('#editHistory').append(template('editHistory-modules', obj))
			}
			if (res['experiences']) {
				var obj = {};
				obj.list = res['experiences'];
				$('#experiences').append(template('experiences-modules', obj))
			}
			if (res['educations']) {
				var obj = {};
				obj.list = res['educations'];
				$('#educations').append(template('educations-modules', obj))
			}
		}
		if (isLogin()) {
			mui.ajax(config.ME_API + 'h5/h5GetResume', {
				data: {
					h5UserId: getUserId()
				},
				dataType: 'json',
				type: 'post',
				timeout: 10000,
				success: function (res) {
					if (res.code == 2) {
						this.init(res.data.appTdResume)
					} else {
						mui.toast(res.msg);
					}
				},
				error: function (xhr, type, errorThrown) {
					mui.toast('网络连接失败, 请稍后再试!')
				}
			})
		} else {
			mui.toast('请先登录!');
		}
	</script>
	<!-- 工作经历模板 -->
	<script id="history-modules" type="text/html">
		<%for(var i = 0; i < list.length; i ++) {%>
			<div class="flex-row-center">
				<div class="comp"><%=list[i].workCompanyName%></div>
				<div class="time"><%=$imports.dateSplit(list[i].entryTime, 1)%>-<%=$imports.dateSplit(list[i].entryTime, 1)%></div>
			</div>
			<div class="position"><%=list[i].workPosition%></div>
			<div class="desc">工作内容：<%=list[i].workContent%> </div>
		<%}%>
	</script>
	<!-- 项目经验模板 -->
	<script id="experiences-modules" type="text/html">
		<%for(var i = 0; i< list.length; i ++) {%>
			<div class="flex-row-center">
				<div class="comp"><%=list[i].projectName%></div>
				<div class="time"><%=$imports.dateSplit(list[i].beginTime, 1)%>-<%=$imports.dateSplit(list[i].endTime, 1)%></div>
			</div>
			<div class="position"><%=list[i].position%></div>
			<div class="desc">工作内容：<%=list[i].projectIntroduce%> </div>
		<%}%>
	</script>
	<!-- 教育经历模板 -->
	<script id="educations-modules" type="text/html">
		<%for(var i = 0; i< list.length; i ++) {%>
			<div class="comp"><%=list[i].school%></div>
			<div class="flex-row-center">
				<div class="desc"><%=$imports.config.resume_edu[list[i].degree]%> <%=list[i].specialty%></div>
				<div class="time"><%=$imports.dateSplit(list[i].entranceTime, 0)%>-<%=$imports.dateSplit(list[i].graduationTime, 0)%></div>
			</div>
		<%}%>
	</script>
</body>

</html>